package tests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import code.Action;
import code.ActionFinishedException;
import code.ForseeableAction;

public class ForseeableActionTest extends ActionTest {

	@Test(expected = ActionFinishedException.class)
	public void testActionFinished() throws ActionFinishedException {
		super.testActionFinished();
	}

	@Test
	public void testActionFinishedInTwoSteps() {
		Action a = createAction();
		try {
			a.doStep();
			a.doStep();
		} catch (ActionFinishedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		assertTrue(a.isFinished());
	}

	@Override
	protected Action createAction() {
		return new ForseeableAction(2);
	}

}
